Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): make deprecated shorthand fields take precedence when new value is null #13589

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

nowNick
Copy link
Contributor

@nowNick nowNick commented Aug 28, 2024

Summary

When both new field and shorthand fields are used but the new field contains null value and the old field contains some other specific value this change allows for that specific value to overwrite the new null value. If a user wants to set explicit null they have to send request without the old value.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

KAG-5287

@nowNick nowNick requested a review from bungle August 28, 2024 13:27
@github-actions github-actions bot added core/db schema-change-noteworthy cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Aug 28, 2024
@nowNick nowNick force-pushed the fix/nulls-aware-shorthands branch 2 times, most recently from 5399874 to 54f5c74 Compare August 28, 2024 13:35
@nowNick nowNick force-pushed the fix/nulls-aware-shorthands branch from 54f5c74 to c3321f4 Compare August 28, 2024 13:39
@nowNick nowNick added this to the 3.8.0 milestone Aug 28, 2024
@nowNick nowNick marked this pull request as ready for review August 28, 2024 15:37
@nowNick nowNick requested a review from a team August 28, 2024 16:20
Copy link
Member

@samugi samugi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so basically both: { new_field = null, deprecated_field = 123 } and { new_field = 123, deprecated_field = null } would produce: { new_field = 123 }, did I get it right?

@kikito kikito merged commit 83de843 into master Aug 29, 2024
33 checks passed
@kikito kikito deleted the fix/nulls-aware-shorthands branch August 29, 2024 08:32
@team-gateway-bot
Copy link
Collaborator

@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-13589-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-13589-to-master-to-upstream
git checkout -b cherry-pick-13589-to-master-to-upstream
ancref=$(git merge-base 4d7934b85d23441f910aa3287c1fab4947e3055f c3321f4f580bd785d718bdf5949ae708d2081b04)
git cherry-pick -x $ancref..c3321f4f580bd785d718bdf5949ae708d2081b04

@github-actions github-actions bot added the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Aug 29, 2024
@kikito kikito removed the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants